﻿<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:prism="clr-namespace:Microsoft.Practices.Prism.Regions;assembly=Microsoft.Practices.Prism" 
	xmlns:utils="clr-namespace:EIA.SLClient.Utility.Controls;assembly=EIA.SLClient.Utility"
    xmlns:local="clr-namespace:EIA.SLClient.PlatManage" 
    xmlns:EIA_SLClient_Utility_Converters="clr-namespace:EIA.SLClient.Utility.Converters;assembly=EIA.SLClient.Utility" x:Class="EIA.SLClient.ProjectManage.MainPage" 
    mc:Ignorable="d"
    d:DesignHeight="768" d:DesignWidth="1024">
	<UserControl.Resources>
		<ItemsPanelTemplate x:Key="QuickQueryItemsPanelTemplate">
			<StackPanel Orientation="Horizontal" ScrollViewer.HorizontalScrollBarVisibility="Auto" Margin="10,0" HorizontalAlignment="Left" VerticalAlignment="Center"/>
		</ItemsPanelTemplate>
		<ItemsPanelTemplate x:Key="ToolbarItemsPanelTemplate">
			<StackPanel Orientation="Horizontal" ScrollViewer.HorizontalScrollBarVisibility="Auto" VerticalAlignment="Center" HorizontalAlignment="Left"/>
		</ItemsPanelTemplate>
		<ItemsPanelTemplate x:Key="ProjectToolItemsPanelTemplate">
			<StackPanel Orientation="Horizontal" VerticalAlignment="Center"/>
		</ItemsPanelTemplate>
	</UserControl.Resources>

    <Grid x:Name="LayoutRoot" Background="White" Visibility="{Binding IsShow, Converter={StaticResource Bool2VisibilityConverter}}">
    	<Grid.RowDefinitions>
    		<RowDefinition Height="74"/>
    		<RowDefinition/>
    		<RowDefinition Height="40"/>
    	</Grid.RowDefinitions>
		<utils:TilePanel Grid.RowSpan="5" TileHeight="18" TileWidth="18" d:IsLocked="True" >
			<utils:TilePanel.Image>
				<ImageBrush Stretch="Fill" ImageSource="assets/img/main_bg.png"/>
			</utils:TilePanel.Image>
		</utils:TilePanel>
    	<Grid x:Name="Footer" Grid.Row="2">
    		<Grid Height="32" VerticalAlignment="Bottom">
    			<Grid.Background>
    				<ImageBrush Stretch="Fill" ImageSource="assets/img/footer_bg.png"/>
    			</Grid.Background>
    		</Grid>
    		<ContentControl x:Name="FooterContentControl" prism:RegionManager.RegionName="FooterRegion" Margin="0"/>
    	</Grid>
    	<Grid x:Name="ProjectList" Grid.Row="1" Margin="30,0">
    		<Grid.RowDefinitions>
    			<RowDefinition Height="180"/>
    			<RowDefinition Height="38"/>
    			<RowDefinition/>
    		</Grid.RowDefinitions>
    		<Grid Margin="0,16">
    			<Grid.Background>
    				<ImageBrush Stretch="Fill" ImageSource="assets/img/quick_query_bg.png"/>
    			</Grid.Background>
    			<ItemsControl x:Name="QuickQueryItemsControl" prism:RegionManager.RegionName="QuickQueryRegion" ItemsPanel="{StaticResource QuickQueryItemsPanelTemplate}" Margin="4" ScrollViewer.HorizontalScrollBarVisibility="Auto"/>
    		</Grid>
    		<Grid Grid.Row="2" Margin="0">
    			<ContentControl x:Name="ProjectListContentControl" prism:RegionManager.RegionName="ProjectListRegion" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"/>
    		</Grid>
    		<Grid Grid.Row="1" Margin="0" Height="38" VerticalAlignment="Top">
    			<Grid.ColumnDefinitions>
    				<ColumnDefinition/>
    				<ColumnDefinition Width="530"/>
    			</Grid.ColumnDefinitions>
    			<ItemsControl x:Name="ToolbarItemsControl" prism:RegionManager.RegionName="ToolbarRegion" ItemsPanel="{StaticResource ToolbarItemsPanelTemplate}" VerticalAlignment="Top"/>
    			<ContentControl x:Name="QueryContentControl" prism:RegionManager.RegionName="QueryRegion" Grid.Column="1" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" VerticalAlignment="Top"/>
    		</Grid>
    	</Grid>
    	<Grid x:Name="Header">
    		<Grid.Background>
    			<ImageBrush Stretch="Fill" ImageSource="assets/img/header_bg.png"/>
    		</Grid.Background>
    		<Image HorizontalAlignment="Left" Source="assets/img/logo.png" Stretch="Fill" Width="400"/>
    		<ContentControl x:Name="HeaderContentControl" prism:RegionManager.RegionName="HeaderRegion" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"/>
    	</Grid>
    	<Grid x:Name="ProjectDetail" Grid.Row="1" d:IsHidden="True">
    		<Grid.RowDefinitions>
    			<RowDefinition Height="32"/>
    			<RowDefinition Height="29"/>
    			<RowDefinition/>
    		</Grid.RowDefinitions>
    		<Grid Background="#FF4C4C4C">
    			<Rectangle Stroke="#FFE0E0E0" Margin="0,0,0,-1" Fill="#FF4C4C4C"/>
    			<ContentControl x:Name="ProjectTileContentControl" prism:RegionManager.RegionName="ProjectTileRegion" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Margin="1,0"/>
    		</Grid>
    		<Grid Grid.Row="1" >
    			<Rectangle Stroke="#FFE0E0E0">
    				<Rectangle.Fill>
    					<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
    					<GradientStop Color="#FFFCFCFC" Offset="0"/>
    					<GradientStop Color="#FFEBEBEB" Offset="1"/>
    					</LinearGradientBrush>
    				</Rectangle.Fill>
    			</Rectangle>
    			<ItemsControl x:Name="ProjectToolbarItemsControl" prism:RegionManager.RegionName="ProjectToolbarRegion" VerticalAlignment="Top" VerticalContentAlignment="Center" Margin="1,0" ItemsPanel="{StaticResource ProjectToolItemsPanelTemplate}" HorizontalContentAlignment="Left" HorizontalAlignment="Right"/>
    		</Grid>
    		<Grid Grid.Row="3" Background="White">
    			<ContentControl x:Name="ProjectMainContentControl" prism:RegionManager.RegionName="ProjectMainRegion" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"/>
    		</Grid>
    	</Grid>
    	<ContentControl x:Name="PopupContentControl" prism:RegionManager.RegionName="PopupRegion" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Grid.RowSpan="3"/>

    	<ContentControl x:Name="NotificationContentControl" prism:RegionManager.RegionName="NotificationRegion" Grid.RowSpan="3" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"/>

    	<ContentControl x:Name="OverlayContentControl" prism:RegionManager.RegionName="OverlayRegion" Grid.RowSpan="3" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"/>

    </Grid>
</UserControl>
